package sfy.md.behavior.iterator;

import java.util.ArrayList;
import java.util.List;

public abstract class ContainerAbstract<T> implements InteratorManger<T>{
    List<T> container = new ArrayList<>();

    abstract void add(T t);
    abstract InteratorManger getInterator();

    int i = 0;

    @Override
    public boolean hasNext() {
        if (container.size()>0) {
            return true;
        }
        return false;
    }

    @Override
    public T next() {
        i++;
        T t =   container.get(0);
        container.remove(0);
        return t;
    }
}
